package com.mate.cloud.inventory.controller;

import com.mate.cloud.common.response.BaseResponse;
import com.mate.cloud.common.web.controller.AdminBaseController;
import com.mate.cloud.inventory.service.InventoryService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/inventory")
public class InventoryController extends AdminBaseController {

    @Resource
    private InventoryService inventoryService;

    /**
     * 查询产品库存
     */
    @GetMapping("/{productId}")
    public BaseResponse getInventory(@PathVariable String productId) {
        return successBodyResponse(inventoryService.getInventory(productId));
    }
}
